<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var names = ['tom', 'jack', 'alice', 'lucy']

        // console.log(names[0])
        // console.log(names.length)
        // console.log(names[8])

        // names.sort()
        // console.log(names)

        var nums = [12,4,35,2,7,34,8,31,352,89]
        // nums.sort() // 默认按字符的ASCII来排序
        // nums.reverse()
        // nums.push(666)
        // console.log(nums.join('-'))
        // console.log(nums.indexOf(34))
        console.log(nums.slice(1,5)) // 左闭右开
        console.log(nums.slice(1))

        console.log(nums)
    </script>
</head>
<body>
    
</body>
</html>